import { request } from "./request";
const warningApi = {

    // ------------------------ 智能预警 ----------------
    alarmFindByList: (data: any) => {
        return request({
            data,
            url: '/alarm/findByList',
            method: 'post',
        })
    },
    alarmGetAlarmNum: (params: any) => {
        return request({
            params,
            url: '/alarm/getAlarmNum',
            method: 'get',
        })
    },
    alarmSimulation: (params: any) => {
        return request({
            params,
            url: '/alarm/simulation',
            method: 'get',
        })
    },
    alarmGetData: (params: any) => {
        return request({
            params,
            url: '/alarm/getData',
            method: 'get',
        })
    },
    getKeLiNum: (params: any) => {
        return request({
            params,
            url: '/alarm/getKeLiNum',
            method: 'get',
        })
    },
    getProdNum: (params: any) => {
        return request({
            params,
            url: '/alarm/getProdNumByKeLiNum',
            method: 'get',
        })
    },
    getKeLiFeeding: (params: any) => {
        return request({
            params,
            url: '/alarm/geKeLiFeeding',
            method: 'get',
        })
    },

    getJGFeeding: (params: any) => {
        return request({
            params,
            url: '/alarm/geJGFeeding',
            method: 'get',
        })
    },
    getTQFeeding: (params: any) => {
        return request({
            params,
            url: '/alarm/geTQFeeding',
            method: 'get',
        })
    },

    materialStockList: (data: any) => {
        return request({
            data,
            url: '/materialStock/findByList',
            method: 'post',
        })
    },
    getAccountList: (params: any) => {
        return request({
            params,
            url: '/psAccount/findPcAccountByCondition',
            method: 'get',
        })
    },
    planAdd: (data: any) => {
        return request({
            data,
            url: '/plan/add',
            method: 'post',
        })
    },
    planAddV2: (data: any) => {
        return request({
            data,
            url: '/plan/prodScheduling',
            method: 'post',
        })
    },
    getMaterList: (params: any) => {
        return request({
            params,
            url: '/materialBreed/findByTypeName',
            method: 'get',
        })
    },
    getProcessPlanList: (data: any) => {
        return request({
            data,
            url: '/plan/findByList',
            method: 'post',
        })
    },
    getDecomposePlan: (params: any) => {
        return request({
            params,
            url: '/plan/decompose',
            method: 'get',
        })
    },
    getIssuancePlan: (params: any) => {
        return request({
            params,
            url: '/plan/issuance',
            method: 'get',
        })
    },
    getPlanStop: (params: any) => {
        return request({
            params,
            url: '/plan/stop',
            method: 'get',
        })
    },
    getPlanDetial: (params: any) => {
        return request({
            params,
            url: '/plan/findById',
            method: 'get',
        })
    },
    postFindDetailByList: (data: any) => {
        return request({
            data,
            url: '/plan/findDetailByList',
            method: 'post',
        })
    },
    postFindDetailById: (params: any) => {
        return request({
            params,
            url: '/plan/findDetailById',
            method: 'get',
        })
    },
    getAlarmInfo: () => {
        return request({
            url: '/alarm/getAlarmInfo',
            method: 'get',
        })
    },
    getPlanInfo: () => {
        return request({
            url: '/plan/getPlanInfo',
            method: 'get',
        })
    },
    getNeedNum: (params: { id: string, need: number }) => {
        return request({
            params,
            url: '/alarm/getNeedNum',
            method: 'get',
        })
    },
    postBindBatch: (data) => {
        return request({
            data,
            url: '/plan/bindBatch',
            method: 'post',
        })
    },
    getMaterialBreed: (id: string) => {
        return request({
            params: { id },
            url: '/materialBreed/getById',
            method: 'get',
        })
    },
    getPlanInfoV2: (id: string) => {
        return request({
            params: { id },
            url: '/plan/getInfo',
            method: 'get',
        })
    },
    getPlanDetailV2: (id: string) => {
        return request({
            params: { id },
            url: '/plan/getPlan',
            method: 'get',
        })
    },
    editPlanV2: (data: any) => {
        return request({
            data,
            url: '/plan/edit',
            method: 'post',
        })
    },
    chartStatistics: (data:any) => {
        return request({
            data,
            url: '/materialStock/statistics',
            method: 'post',
        })
    },
    finishPlan:(params:any)=>{
        return request({
            params,
            url:'/plan/finish',
            method:'get'
        })
    },
    exportData:(data:any,callback:any)=>{
        return request({
            data,
            url:'/alarm/exportAlarmData',
            method:'post',
            responseType:'blob'
        },callback)
    }
}
export default warningApi
